package com.innovation.chengzhangriji.ui;

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

import com.innovation.chengzhangriji.Flavors;
import com.innovation.chengzhangriji.R;
import com.innovation.chengzhangriji.ui.widget.CuteTextView;
import com.innovation.chengzhangriji.ui.widget.CuteToolbar;

public class AboutUsActivity extends BaseActivity implements CuteToolbar.OnClickCuteToolbarListener {

    private CuteToolbar toolbar;

    private CuteTextView txtVersion;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);

        // 初始化视图
        setLayout();
    }

    private void setLayout() {

        // 导航条
        toolbar = (CuteToolbar) findViewById(R.id.toolbar);
        toolbar.setOnClickCuteToolbarListener(this);

        // 版本号
        txtVersion = (CuteTextView) findViewById(R.id.text_version);
        try {
            txtVersion.setText("成长日记 " + getPackageManager().getPackageInfo(getPackageName(), 1).versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            txtVersion.setText("成长日记");
        }
    }

    @Override
    public void onClickLeft() {
        onBackPressed();
    }

    @Override
    public void onClickRight() {

    }
}
